home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: dereferencing pointer to incomplete type
- Date: 4 Mar 96 14:53:03 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.825951183@rscernix>
- References: <1996Mar3.040741.27234@dcs.warwick.ac.uk>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <1996Mar3.040741.27234@dcs.warwick.ac.uk> D.C.Molero@dcs.warwick.ac.uk (Daniel Castillo Molero) writes:
-
- >I wonder if anybody can help me to debug the short code below.
- >It is supposed to calculate the area of a polygon, but when I compile
- >it with gcc program.c, it gives me the following errors,
- >
- >program.c: In function `calc_area':
- >program.c:22: warning: assignment from incompatible pointer type
- >program.c:24: dereferencing pointer to incomplete type
- >program.c:24: dereferencing pointer to incomplete type
- >program.c:26: warning: assignment from incompatible pointer type
- >
- >
- >which I don't understand at all.
- >
- >I would appreciate very much any sort of help.
- >
- >------------------
- >
- >struct polygon
- >{
- > int tried;
- > double x, y;
- > int dir, numtimes, conv;
- > struct polyg *next;
- ^^^^^^^^^^^^
- >};
-
- I can't see any definition for struct polyg in the posted code.
- It's obvious that you meant "struct polygon", but it's not obvious at
- all why you can't find your typos yourself.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-